# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=ortp
pkgver=5.3.38
pkgrel=0
pkgdesc="oRTP is a library implemeting Real-time Transport Protocol (RFC3550), licensed under LGPL"
url="https://www.linphone.org/technical-corner/ortp"
arch="all"
options="!check" #no test avail
license="LGPL-2.0-or-later"
makedepends="cmake bctoolbox-dev samurai"
subpackages="$pkgname-doc $pkgname-dev"
source="https://gitlab.linphone.org/BC/public/ortp/-/archive/$pkgver/ortp-$pkgver.tar.gz
	fix-pkgconfig-pc-file.patch
	fix-cmake-path.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DENABLE_STATIC=NO \
		-DENABLE_UNIT_TESTS=OFF \
		-DBUILD_SHARED_LIBS=YES .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
83a5d549767f92352235a1ae146c9c98f0fb83fc52101fd7f955ae978231b978d376742689d951f045eee1f639ed973169775068b546089049cc34573da7f251  ortp-5.3.38.tar.gz
f889b47bf3d6a47d05b56c14a601328d636ea858a5abef0873b3bef329822a7271ada2ed2d8c4b09edddb59882f54752a8fcc3d8d067ee832631af7161505222  fix-pkgconfig-pc-file.patch
19613325809a3086403ef87d67a12707d85e56d455b7fd57dae5e09635743d2d04c41f85b3b60441ee60ef93f4143c531dc7cbdc4818e64d8611c70bf5b38c15  fix-cmake-path.patch
"
